﻿<RadzenHtmlEditor style="height: 200px;" Execute=@OnExecute>
    <RadzenHtmlEditorCustomTool CommandName="InsertToday" Icon="today" Title="Insert today" />
</RadzenHtmlEditor>

@code {
    async Task OnExecute(HtmlEditorExecuteEventArgs args)
    {
        if (args.CommandName == "InsertToday")
        {
            await InsertDate(args.Editor, DateTime.Now);
        }
    }

    async Task InsertDate(RadzenHtmlEditor editor, DateTime date)
    {
        await editor.ExecuteCommandAsync(HtmlEditorCommands.InsertHtml, $"<strong>{date.ToLongDateString()}</strong>");
    }
}